package com.ruoyi.anfang.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.anfang.mapper.MoEquipmentMapper;
import com.ruoyi.anfang.domain.MoEquipment;
import com.ruoyi.anfang.service.IMoEquipmentService;

/**
 * 设备Service业务层处理
 * 
 * @author wzy
 * @date 2024-07-16
 */
@Service
public class MoEquipmentServiceImpl implements IMoEquipmentService 
{
    @Autowired
    private MoEquipmentMapper moEquipmentMapper;

    /**
     * 查询设备
     * 
     * @param id 设备主键
     * @return 设备
     */
    @Override
    public MoEquipment selectMoEquipmentById(Long id)
    {
        return moEquipmentMapper.selectMoEquipmentById(id);
    }

    /**
     * 查询设备列表
     * 
     * @param moEquipment 设备
     * @return 设备
     */
    @Override
    public List<MoEquipment> selectMoEquipmentList(MoEquipment moEquipment)
    {
        return moEquipmentMapper.selectMoEquipmentList(moEquipment);
    }

    /**
     * 新增设备
     * 
     * @param moEquipment 设备
     * @return 结果
     */
    @Override
    public int insertMoEquipment(MoEquipment moEquipment)
    {
        moEquipment.setCreateTime(DateUtils.getNowDate());
        return moEquipmentMapper.insertMoEquipment(moEquipment);
    }

    /**
     * 修改设备
     * 
     * @param moEquipment 设备
     * @return 结果
     */
    @Override
    public int updateMoEquipment(MoEquipment moEquipment)
    {
        moEquipment.setUpdateTime(DateUtils.getNowDate());
        return moEquipmentMapper.updateMoEquipment(moEquipment);
    }

    /**
     * 批量删除设备
     * 
     * @param ids 需要删除的设备主键
     * @return 结果
     */
    @Override
    public int deleteMoEquipmentByIds(Long[] ids)
    {
        return moEquipmentMapper.deleteMoEquipmentByIds(ids);
    }

    /**
     * 删除设备信息
     * 
     * @param id 设备主键
     * @return 结果
     */
    @Override
    public int deleteMoEquipmentById(Long id)
    {
        return moEquipmentMapper.deleteMoEquipmentById(id);
    }
}
